/*
 * Copyright (C) 2010 Tetsuya Yasuda <tetsuyayasuda@gmail.com>
 */
package jp.tyas.libs.lisp;

public class BlockContext extends Context
{
    String name;
    Object result = null;

    public BlockContext (Context parent, String name)
    {
        super(parent);
        this.name = name;
    }

    public void set (Symbol sym)
    {
        throw new LispError("Block can't take Symbol");
    }

    public Symbol get (String name)
    {
        return null;
    }

    public void setResult (Object o)
    {
        result = o;
    }

    public Object getResult ()
    {
        return result;
    }

    public BlockContext findBlock (String name)
    {
        if (this.name.equals (name))
            return this;
        return super.findBlock(name);
    }
}
